import request from '@/utils/request'
const req = request.service;

export default{
    queryDeptTree(data){

        const postData = data || {}
        return req({
            url: "/role/dept/tree",
            method: 'post',
            data:postData
        })
    },
    queryRole(data){

        const postData = data || {}
        return req({
            url: "/role",
            method: 'post',
            data:postData
        })
    },
    saveRole(data){
        return req({
            url: data.jsbh?'/role/save':'/role/add',
            method: 'post',
            data:data
        })
    },
    delRole(data){
        return req({
            url: '/role/delete',
            method: 'post',
            data:data
        })
    },
    queryUser(data){
        return req({
            url: '/role/user',
            method: 'post',
            data:data
        })
    },
    saveUser(type,data){
        return req({
            url: type==0?"/role/user/add":"/role/user/delete",
            method: 'post',
            data:data
        })
    },
}